package com.feature.core.webmvc;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "spring.webmvc")
public class WebMvcProperties {

	private CROS cros = new CROS();

	public CROS getCros() {
		return cros;
	}

	public void setCros(CROS cros) {
		this.cros = cros;
	}

	public static class CROS {
		private boolean enabled = false;
		private String mapping = "/**";
		private String allowedOrigins;
		private String allowedHeaders = "*";
		private boolean allowCredentials = true;
		private String allowedMethods = "POST,GET,PUT,OPTIONS,DELETE";
		private Integer maxAge = 168000;

		public boolean isEnabled() {
			return enabled;
		}

		public void setEnabled(boolean enabled) {
			this.enabled = enabled;
		}

		public String getMapping() {
			return mapping;
		}

		public void setMapping(String mapping) {
			this.mapping = mapping;
		}

		public String getAllowedOrigins() {
			return allowedOrigins;
		}

		public void setAllowedOrigins(String allowedOrigins) {
			this.allowedOrigins = allowedOrigins;
		}

		public String getAllowedHeaders() {
			return allowedHeaders;
		}

		public void setAllowedHeaders(String allowedHeaders) {
			this.allowedHeaders = allowedHeaders;
		}

		public boolean isAllowCredentials() {
			return allowCredentials;
		}

		public void setAllowCredentials(boolean allowCredentials) {
			this.allowCredentials = allowCredentials;
		}

		public Integer getMaxAge() {
			return maxAge;
		}

		public void setMaxAge(Integer maxAge) {
			this.maxAge = maxAge;
		}

		public String getAllowedMethods() {
			return allowedMethods;
		}

		public void setAllowedMethods(String allowedMethods) {
			this.allowedMethods = allowedMethods;
		}

	}
}
